package com.freud.logic.index.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import com.freud.framework.base.BaseController;
import com.freud.framework.spring.security.SecurityContextUtil;
import com.freud.logic.business.service.GoodService;
import com.freud.logic.business.service.DistrictService;

@Controller
@EnableWebMvc
public class IndexController extends BaseController {

	@Autowired
	private GoodService answerService;

	@Autowired
	private DistrictService questionService;

	@RequestMapping({ "", "/", "/index" })
	public ModelAndView index() {
		ModelAndView mav = new ModelAndView();
		if (SecurityContextUtil.getUserDetails() == null) {
			mav.setViewName("redirect:/auth/login");
		} else {
			mav.setViewName("index");
		}
		return mav;
	}
}
